package cn.grayrelese;

import cn.grayrelese.filter.GrayReleseFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

//允许断路器
//@EnableCircuitBreaker
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
//@RestController
public class ZuulApplication {
//    @Value("${grayrelese.test}")
//    private String test;
//    @Value("#{${grayrelese.users}}")
//    private List<User> users; // 字符串列表


    public static void main(String[] args) {
        SpringApplication.run(ZuulApplication.class, args);
    }

    @Bean
    public GrayReleseFilter simpleFilter() {
        return new GrayReleseFilter();
    }


    /**
     * rest客户端
     * @return
     */
    /*@Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }*/
//    @RequestMapping(value = "/test")
//    public String helloWord() {
//        return "服务端口为: " + users;
//    }
}